import request from '@/utils/request'

export function hanzi2pinyin(params) {
  return request({
    url: '/finance/hz2py/',
    method: 'GET',
    params
  })
}

export function getCustomers(query) {
  return request({
    url: '/finance/customer/',
    method: 'GET',
    params: query
  })
}

export function addCustomer(customerInfo) {
  return request({
    url: '/finance/customer/',
    method: 'POST',
    data: customerInfo
  })
}

export function updateCustomer(customerInfo) {
  return request({
    url: `/finance/customer/${customerInfo.id}/`,
    method: 'PATCH',
    data: customerInfo
  })
}

export function delCustomer(customer_id) {
  return request({
    url: `/finance/customer/${customer_id}/`,
    method: 'DELETE',
  })
}


export function getCasePersons(query) {
  return request({
    url: '/finance/case_person/',
    method: 'GET',
    params: query
  })
}

export function addCasePerson(personInfo) {
  return request({
    url: '/finance/case_person/',
    method: 'POST',
    data: personInfo
  })
}

export function updateCasePerson(personInfo) {
  return request({
    url: `/finance/case_person/${personInfo.id}/`,
    method: 'PATCH',
    data: personInfo
  })
}

export function delCasePerson(person_id) {
  return request({
    url: `/finance/case_person/${person_id}/`,
    method: 'DELETE',
  })
}
// 负责律师
export function getCaselawyers(query) {
  return request({
    url: '/finance/case_lawyer/',
    method: 'GET',
    params: query
  })
}

export function addCaseLawyer(data) {
  return request({
    url: '/finance/case_lawyer/',
    method: 'POST',
    data
  })
}

export function updateCaseLawyer(lawyerInfo) {
  return request({
    url: `/finance/case_lawyer/${lawyerInfo.id}/`,
    method: 'PATCH',
    data: lawyerInfo
  })
}

export function delCaseLawyer(lawyer_id) {
  return request({
    url: `/finance/case_lawyer/${lawyer_id}/`,
    method: 'DELETE',
  })
}

export function updateCaseLawyers(data) {
  return request({
    url: '/finance/case_lawyer/update/',
    method: 'PATCH',
    data
  })
}

export function getCustomerList() {
  return request({
    url: '/finance/customer_list/',
    method: 'GET'
  })
}
